package com.sixth.service.impl;

import com.sixth.dao.AclRoleDao;
import com.sixth.dao.AclUserDao;
import com.sixth.entity.AclRole;
import com.sixth.service.AclUserService;
import com.sixth.until.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * @program: self-tui-education
 * @description:
 * @author: 高振杨
 * @create: 2022-04-25 15:57
 **/
@Service
public class AclUserServiceImpl implements AclUserService {
    @Autowired
    private AclUserDao aclUserDao;
    @Autowired
    private AclRoleDao aclRoleDao;
    @Override
    public CommonResult findRoleByUserId(String userId) {

        Map<String,Object> map = new LinkedHashMap<>();
        List<String> ids=aclRoleDao.findAllRoleid();
        List<String> userRoleIds=aclRoleDao.findRoleByUserId(userId);
        map.put("userRoleIds",userRoleIds);
        map.put("allRole",ids);
        return new CommonResult(2000,"查询成功",map);
    }
}
